package com.paopao.common.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

public class BaseDaoSupport implements BaseDao {

	@Autowired
	SqlSession sqlSession;

	public List<Object> findAll(String str)
	{
		return sqlSession.selectList(str);
	}

	public List<Object> findByPage(String str, Map<String, Object> map)
	{
		return sqlSession.selectList(str,map);
	}

	public Object findById(String str, String id)
	{
		return sqlSession.selectOne(str, id);
	}

	public List<Object> findOneByProperty(String str, Object Obj)
	{
		return sqlSession.selectList(str,Obj);
	}

	public Integer updateOne(String str, Object obj)
	{
		return sqlSession.update(str, obj);
	}

	public Integer deleteById(String str, String id)
	{
		return sqlSession.update(str, id);
	}

	public Object findMaxId(String str)
	{
		return sqlSession.selectOne(str);
	}
}
